/*
 * Created on 2006-02-18
 */
package dk.aiszone.lang.autosource.formatter;

import dk.aiszone.lang.autosource.generatorobjects.AbstractBody;
import dk.aiszone.lang.autosource.generatorobjects.Annotation;
import dk.aiszone.lang.autosource.generatorobjects.Argument;
import dk.aiszone.lang.autosource.generatorobjects.Class;
import dk.aiszone.lang.autosource.generatorobjects.ClassBody;
import dk.aiszone.lang.autosource.generatorobjects.Declaration;
import dk.aiszone.lang.autosource.generatorobjects.GenericClass;
import dk.aiszone.lang.autosource.generatorobjects.Import;
import dk.aiszone.lang.autosource.generatorobjects.InterfaceBody;
import dk.aiszone.lang.autosource.generatorobjects.JavaDoc;
import dk.aiszone.lang.autosource.generatorobjects.JavaFile;
import dk.aiszone.lang.autosource.generatorobjects.Method;
import dk.aiszone.lang.autosource.generatorobjects.MethodDeclaration;
import dk.aiszone.lang.autosource.generatorobjects.StaticArea;
import dk.aiszone.lang.autosource.generatorobjects.Variable;
import dk.aiszone.lang.autosource.generatorobjects.helpers.ImportsList;

/**
 * Common interface implemented by the different java source formatters.
 * 
 * @author <a href="mailto:ais@mail.dk">Ais</a>
 */
public interface JavaFormatter {

    /**
     * Formats the supplied <code>AbstractBody</code> to java source code.
     * 
     * @param body
     *            The <code>AbstractBody</code> to format
     * @param level
     *            The tab level to indent the <code>AbstractBody</code> source representation with
     * @return Java source representation of the <code>AbstractBody</code>
     */
    public abstract String toJava(AbstractBody<?> body, int level);

    /**
     * Formats the supplied <code>Annotation</code> to java source code.
     * 
     * @param annotation
     *            The <code>Annotation</code> to format.
     * @param level
     *            The tab level to indent the <code>AbstractBody</code> source representation with
     * @return Java source representation of the <code>Annotation</code>.
     */
    public abstract String toJava(Annotation annotation, int level);

    /**
     * Formats the supplied <code>Argument</code> to java source code.
     * 
     * @param argument
     *            The <code>Argument</code> to format
     * @return Java source representation of the <code>Argument</code>
     */
    public abstract String toJava(Argument argument);

    /**
     * Formats the supplied <code>Class</code> to java source code.
     * 
     * @param _class
     *            The <code>Class</code> to format
     * @return Java source representation of the <code>Class</code>
     */
    public abstract String toJava(Class _class);

    /**
     * Formats the supplied <code>ClassBody</code> to java source code.
     * 
     * @param body
     *            The <code>ClassBody</code> to format
     * @param level
     *            The tab level to indent the <code>ClassBody</code> source representation with
     * @return Java source representation of the <code>ClassBody</code>
     */
    public abstract String toJava(ClassBody body, int level);

    /**
     * Formats the supplied <code>Declaration</code> to java source code.
     * 
     * @param declaration
     *            The <code>Declaration</code> to format
     * @return Java source representation of the <code>Declaration</code>
     */
    public abstract String toJava(Declaration declaration);

    /**
     * Formats the supplied <code>GenericClass</code> to java source code.
     * 
     * @param genericClass
     *            The <code>GenericClass</code> to format.
     * @return Java source representation of the <code>GenericClass</code>.
     */
    public abstract String toJava(GenericClass genericClass);

    /**
     * Formats the supplied <code>Import</code> to java source code.
     * 
     * @param _import
     *            The <code>Import</code> to format
     * @return Java source representation of the <code>Import</code>
     */
    public abstract String toJava(Import _import);

    /**
     * Formats the supplied <code>ImportsList</code> to java source code.
     * 
     * @param importsList
     *            The <code>ImportsList</code> to format
     * @return Java source representation of the <code>Imp</code>
     */
    public abstract String toJava(ImportsList importsList);

    /**
     * Formats the supplied <code>InterfaceBody</code> to java source code.
     * 
     * @param body
     *            The <code>InterfaceBody</code> to format
     * @param level
     *            The tab level to indent the <code>InterfaceBody</code> source representation with
     * @return Java source representation of the <code>InterfaceBody</code>
     */
    public abstract String toJava(InterfaceBody body, int level);

    /**
     * Formats the supplied <code>JavaDoc</code> to java source code.
     * 
     * @param javaDoc
     *            The <code>JavaDoc</code> to format
     * @param level
     *            The tab level to indent the <code>JavaDoc</code> source representation with
     * @return Java source representation of the <code>JavaDoc</code>
     */
    public abstract String toJava(JavaDoc javaDoc, int level);

    /**
     * Formats the supplied <code>JavaFile</code> to java source code.
     * 
     * @param file
     *            The <code>JavaFile</code> to format
     * @return Java source representation of the <code>JavaFile</code>
     */
    public abstract String toJava(JavaFile file);

    /**
     * Formats the supplied <code>Method</code> to java source code.
     * 
     * @param method
     *            The <code>Method</code> to format
     * @param level
     *            The tab level to indent the <code>Method</code> source representation with
     * @return Java source representation of the <code>Method</code>
     */
    public abstract String toJava(Method method, int level);

    /**
     * Formats the supplied <code>MethodDeclaration</code> to java source code.
     * 
     * @param declaration
     *            The <code>MethodDeclaration</code> to format
     * @param level
     *            The tab level to indent the <code>MethodDeclaration</code> source representation with
     * @return Java source representation of the <code>MethodDeclaration</code>
     */
    public abstract String toJava(MethodDeclaration declaration, int level);

    /**
     * Formats the supplied <code>StaticArea</code> to java source code.
     * 
     * @param staticArea
     *            The <code>StaticArea</code> to format
     * @param level
     *            The tab level to indent the <code>StaticArea</code> source representation with
     * @return Java source representation of the <code>StaticArea</code>
     */
    public abstract String toJava(StaticArea staticArea, int level);

    /**
     * Formats the supplied <code>Variable</code> to java source code.
     * 
     * @param variable
     *            The <code>Variable</code> to format
     * @param level
     *            The tab level to indent the <code>Variable</code> source representation with
     * @return Java source representation of the <code>Variable</code>
     */
    public abstract String toJava(Variable variable, int level);
}